package com.yunxin.core.infra.persistence.mapper.product;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.yunxin.core.domain.external.product.ProductAllocationDetail;
import com.yunxin.core.domain.model.product.ProductThrowInConfig;
import com.yunxin.core.infra.persistence.entity.product.ProductThrowInConfigDOWithBLOBs;
import com.yunxin.core.infra.persistence.entity.product.query.result.ProductThrowInDetailResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author zero°
 * @since 2023-05-25
 */
@DS("core")
@Mapper
public interface ProductThrowInConfigExtendMapper extends ProductThrowInConfigMapper {

    /**
     * 根据产品id查询产品投放配置
     * @param productId productId
     * @return ProductCustomConfig
     */
    ProductThrowInConfigDOWithBLOBs selectByProductId(@Param("productId") Long productId);
    /**
     * 根据产品id查询产品投放配置详情结果
     * @param productId productId
     * @return ProductThrowInDetailResult
     */
    ProductThrowInDetailResult selectProductThrowInDetailResultByProductId(@Param("productId") Long productId);

    /**
     * 根据产品id集合查询投放配置
     * @param productIds productIds
     * @return List<ProductThrowInConfigDOWithBLOBs>
     */
    List<ProductThrowInConfigDOWithBLOBs> selectThrowInConfigByProductId(@Param("productIds") Set<Long> productIds);

    List<Long> selectThrowInConfigByAbutmentType(@Param("abutmentTypes") Integer[] abutmentTypes);

    List<ProductThrowInConfigDOWithBLOBs> selectByBeProductId(@Param("productId") Long productId);

    List<ProductAllocationDetail> listProductAllocationDetail();
}
